﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using CoreLibrary.Paging;
using CoreLibrary.Service;
using Entities.DataBase.Obj;
using WebService.Service.Transfer;

namespace WebService.Service {

    [ServiceContract]
    public interface IProductCatalogServiceX {

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat  = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate    = "/AddProductCatalog")]
        bool AddProductCatalog(string passport, AddProductCatalogRequest request);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat  = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate    = "/UpdateProductCatalog")]
        bool UpdateProductCatalog(string passport, UpdateProductCatalogRequest request);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/RemoveProductCatalog")]
        bool RemoveProductCatalog(string passport, int catId);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/GetProductCatalog")]
        ProductCatalogInfo GetProductCatalog(string passport, int catalogId);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/GetLeafProductCatalogs")]
        List<ProductCatalogInfo> GetLeafProductCatalogs(string passport);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/GetAllProductCatalogs")]
        List<ProductCatalogInfo> GetAllProductCatalogs(string passport);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/GetProductCatalogs")]
        List<ProductCatalogInfo> GetProductCatalogs(string passport, int catId);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json,
                   UriTemplate = "/ListProductCatalogs")]
        PagingResult<ProductCatalogInfo> ListProductCatalogs(string passport, int catId, PagingRequest request);
       
    }
}
